package com.myosw.pojo;

import java.sql.Timestamp;
import java.util.Date;

import org.ocpsoft.prettytime.PrettyTime;

import com.myosw.enums.UrlEnum;
import com.myosw.util.Base64Coder;

/**
 *  添加的扫描网站
 * @author 陈磊
 *
 */
public class Urls extends POJO {
	/**
	 * 
	 */
	protected static final long serialVersionUID = 1L;
	protected String name;//网址名称 
	protected String url;//网址
	protected String description;//网址简单描述，或备注等相关信息 
//	protected int depth;//指爬行的深度,处于测试的目的,选择深度为 2 ,完 全爬行一般可设定为 10 左右  
//	protected int topN;//指在每层的深度上所要抓取的最大的页面数, 完全抓取可设 定为 1 万到 100 万,这取决于网站资源数量  
//	protected int threads;//threads 指定并发的进程 这是设定为 4  
//	protected int timer;//扫描触发时间，单位分钟 
	protected int total;//总扫描页面数 
	protected int newcount;//新添加页面数 
	protected Timestamp updatetime = new Timestamp(new Date().getTime());;//更新时间 
	protected Timestamp createtime = new Timestamp(new Date().getTime());//创建时间 
	protected int isopen = UrlEnum.Show_status.IsOpen.getValue();//是否在导航栏中显示 1：显示，0：不显示，2：推荐显示 
	protected int isrun = UrlEnum.Run_status.IsRun.getValue();//是否启动运行扫描状态，1：启动，0：关闭 
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getUrl() {
		return url;
	}
	public void setUrl(String url) {
		this.url = url;
	}
	public String getDescription() {
		return description;
	}
	public void setDescription(String description) {
		this.description = description;
	}
//	public int getDepth() {
//		return depth;
//	}
//	public void setDepth(int depth) {
//		this.depth = depth;
//	}
//	public int getTopN() {
//		return topN;
//	}
//	public void setTopN(int topN) {
//		this.topN = topN;
//	}
//	public int getThreads() {
//		return threads;
//	}
//	public void setThreads(int threads) {
//		this.threads = threads;
//	}
//	public int getTimer() {
//		return timer;
//	}
//	public void setTimer(int timer) {
//		this.timer = timer;
//	}
	public int getTotal() {
		return total;
	}
	public void setTotal(int total) {
		this.total = total;
	}
	public int getNewcount() {
		return newcount;
	}
	public void setNewcount(int newcount) {
		this.newcount = newcount;
	}
	public Timestamp getUpdatetime() {
		return updatetime;
	}
	public void setUpdatetime(Timestamp updatetime) {
		this.updatetime = updatetime;
	}
	public Timestamp getCreatetime() {
		return createtime;
	}
	public void setCreatetime(Timestamp createtime) {
		this.createtime = createtime;
	}
	public int getIsopen() {
		return isopen;
	}
	public void setIsopen(int isopen) {
		this.isopen = isopen;
	}
	public int getIsrun() {
		return isrun;
	}
	public void setIsrun(int isrun) {
		this.isrun = isrun;
	}
	
	public String getFtime() 
	{
		return new PrettyTime().format(updatetime);
		
	}

	
	public String getSafeUrl() {
		return Base64Coder.encodeBase64Safe(url);
		
	}
	
	

}
